package com.gaoshu.controller;

import com.gaoshu.bean.Register;
import com.gaoshu.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/RegisterController")
public class RegisterController {
    //对RegisterService层的创建对象
    @Autowired
    RegisterService registerService;

    //查询所有的住院登记
    @RequestMapping("/selectAllRegister.do")
    public String selectAllRegister(Model model){

        //调用service层方法
        List<Register> lists=registerService.selectAllRegister();
        //把数据传到前端页面
        model.addAttribute("lists",lists);

        return "liao/admin.html";
    }

}
